import Api from '@/services/api.js';
import { checkPhoneNumber } from '@/utils/utils';
const app = getApp();
export default {
  data() {
    return {
      list: [],
    }
  },
  computed: {
  },
  onLoad(options) {
    this.getEnterprisesList();
  },
  methods: {
    // 获取企业列表
    async getEnterprisesList() {
      this.list = await this.$Serv.getEnterpriseList('all');
      // const { code, result } = await this.$request({
      //   url: Api.getEnterprisesList,
      // });
      // if (code == 200) {
      //   this.list = result;
      // }
    },
    // 列表点击事件
    handleItem(e) {
      const { item } = e.currentTarget.dataset;
      const encodeValue = encodeURIComponent(JSON.stringify(item));
      this.toEditEnterprise(`?enterpriseInfo=${encodeValue}`)
    },
    navigateToEditEnterprise() {
      this.toEditEnterprise();
    },
    toEditEnterprise(params) {
      let url = '/enterpriseCert/edit/index';
      if (params) {
        url += params
      }
      uni.navigateTo({ url })
    }
  },
  onPullDownRefresh() {
    this.getEnterprisesList();
    uni.stopPullDownRefresh();
  }
}